package ch2_test;

public class GuessGame {
	int targetNum = 0;
	public void startGame() {
		Player player1 = new Player();
		Player player2 = new Player();
		Player player3 = new Player();
		
		targetNum = (int)((Math.random())*10);
		System.out.println("0이상 9이하의 숫자를 맞춰보세요");
		System.out.println("맞춰야 하는 숫자는 " + targetNum + "입니다");
		
		while (true){
			player1.guess();
			player2.guess();
			player3.guess();
			
			System.out.println("1번 선수가 찍은 숫자: " + player1.number);
			System.out.println("2번 선수가 찍은 숫자: " + player2.number);
			System.out.println("3번 선수가 찍은 숫자: " + player3.number);
			
			if (targetNum == player1.number || targetNum == player2.number || targetNum == player3.number){
				break;
			}
		}
		System.out.println("맞춘 선수가 있습니다");
		System.out.println("게임끝");
		
			
	}

}
